<%--
  Created by IntelliJ IDEA.
  User: 东方九夜
  Date: 2021/6/17
  Time: 19:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=utf-8"
		 pageEncoding="utf-8"%>
<%@ page import="bean.*" %>
<%@ page import="dao.*" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.Iterator" %>
<!DOCTYPE HTML>
<html>
<head>
	<meta charset="utf-8" />
	<title>论文上传</title>
	<link type="text/css" rel="stylesheet" href="css/index.css">
	<link type="text/css" rel="stylesheet" href="css/bootstrap.min.css">
</head>
<body>
<%
	Customer c = (Customer) request.getSession().getAttribute("teacher");
	if(c == null){
		response.sendRedirect("Not_Login.jsp");
	}
%>
<div class="main">
	<div class="navigation">
				<span>欢迎回来!
					<%
						if(c != null){
							out.print(c.getName());
						}
					%>
				</span>
		<a class="exit" href="index.jsp"><span>退出登录</span></a>
		<a class="exit" href="Alter_Pwd.jsp"><span>修改密码</span></a>
		<a class="exit" href="Teacher_Info.jsp?ID=<%=c.getId()%>"><span>修改信息</span></a>
	</div>
	<table class="table" style="margin:0 auto;width:90%">
		<tr>
			<td style="width:33%"><button class= "btn btn-info" style="width:100%" onclick="window.location.href='index_Teacher.jsp'">公告</button>	</td>
			<td style="width:33%"><button class= "btn btn-info" style="width:100%" onclick="window.location.href='Student_Data.jsp'">毕设相关</button></td>
			<td style="width:33%"><button class= "btn btn-info" style="width:100%" onclick="window.location.href='Manage_Grades.jsp'">成绩录入</button></td>
		</tr>
	</table>
	<div>
		<%
			String T_Name = c.getName();
			ArrayList<GradeDesign> list = TeacherSql.GetGradeDesign(T_Name);
			GradeDesign gradeDesign = null;
		%>
		<form>
			<table class="table table-hover; table_center" style="margin:0 auto;width:90%;color: white">
				<tr>
					<th>学号</th>
					<th>姓名</th>
					<th></th>
					<th>相关资料</th>
					<th></th>
				</tr>
				<%
					if(list != null){
						Iterator<GradeDesign> iterator = list.iterator();
						while(iterator.hasNext()){
							gradeDesign = iterator.next();
				%>
				<tr>
					<td><%=gradeDesign.getID() %></td>
					<td><%=gradeDesign.getName() %></td>
					<td></td>
					<td>
						<div class="form-group">
							<label >任务书</label>
							<a href="DownloadServlet?Name=<%=gradeDesign.getRWS() %>" style="color: white"><%=gradeDesign.getRWS()%></a>
						</div>
						<div class="form-group">
							<label >开题报告</label>
							<a href="DownloadServlet?Name=<%=gradeDesign.getKTBG() %>" style="color: white"><%=gradeDesign.getKTBG()%></a>
						</div>
					</td>
					<td>
						<div class="form-group">
							<label >毕业论文</label>
							<a href="DownloadServlet?Name=<%=gradeDesign.getBYLW()%>" style="color: white"><%=gradeDesign.getBYLW()%></a>
						</div>
						<div class="form-group">
							<label >代码</label>
							<a href="DownloadServlet?Name=<%=gradeDesign.getCODE() %>" style="color: white"><%=gradeDesign.getCODE()%></a>
						</div>
					</td>
				</tr>
				<%
						}
					}
				%>
			</table>
		</form>
	</div>
	<div class="clear"></div>
</div>

</body>
</html>